import 'package:flutter/material.dart';
import 'package:banner_carousel/banner_carousel.dart';
import 'package:my_flutter_demo/Data/xx_test_datas.dart';
import 'package:my_flutter_demo/Model/xx_models.dart';

class xx_banner_carousel extends StatelessWidget{
  final HomeItem item;
  const xx_banner_carousel({Key?key,required this.item}):super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(item.title)
      ),
      body: Column(
        children: [
          BannerCarousel(
            animation: false,
            viewportFraction: 0.6,
            showIndicator: false,
            customizedBanners: [
              Container(
                  decoration: BoxDecoration(
                    border: Border.all(color: Colors.black,width: 2),),
                  child: Image.network(listBanners[0].imagePath)
              ),
              Container(
                  margin: EdgeInsets.symmetric(horizontal: 30),
                  decoration: BoxDecoration(
                    boxShadow: [
                      BoxShadow(
                        color: Colors.black.withOpacity(0.25),
                        spreadRadius: 0,
                        blurRadius: 4,
                        offset: Offset(0, 3),
                      ),
                    ],
                  ),
                  child: Image.network(listBanners[0].imagePath)
              ),
              Container(
                // margin: EdgeInsets.symmetric(horizontal: 20),
                decoration: BoxDecoration(
                  border: Border.all(
                    color: Colors.green,
                    width: 3,
                  ),
                  borderRadius: BorderRadius.circular(50),
                  image: DecorationImage(
                    image: NetworkImage(
                        'https://flutter.github.io/assets-for-api-docs/assets/widgets/owl-2.jpg'),
                    fit: BoxFit.cover,
                  ),
                ),
              ),
            ],
            indicatorBottom: false,
            onTap: (id) => print(id),
          ),
          SizedBox(height: 15),
          BannerCarousel.fullScreen(
            banners: listBanners,
            onTap: (id) => print(id),
          ),
          SizedBox(height: 15),
          BannerCarousel(
            banners: listBanners,
            onTap: (id) => print(id),
            customizedIndicators: IndicatorModel.animation(width: 20, height: 5, spaceBetween: 2, widthAnimation: 50),
            animation: true,
            margin: EdgeInsets.symmetric(horizontal: 50),
          ),
        ],
      ),
    );
  }

}

